// Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.

// Package localinterface defines some interfaces for converting usage.
package localinterface

import (
	"github.com/gogf/gf/v2/os/gtime"
)

// IVal is used for type assert api for String().
type IVal interface {
	X取值() interface{}
}

// IString is used for type assert api for String().
type IString interface {
	String() string
}

// IBool is used for type assert api for Bool().
type IBool interface {
	X取布尔() bool
}

// IInt64 is used for type assert api for Int64().
type IInt64 interface {
	X取整数64位() int64
}

// IUint64 is used for type assert api for Uint64().
type IUint64 interface {
	X取正整数64位() uint64
}

// IFloat32 is used for type assert api for Float32().
type IFloat32 interface {
	X取小数32位() float32
}

// IFloat64 is used for type assert api for Float64().
type IFloat64 interface {
	X取小数64位() float64
}

// IError is used for type assert api for Error().
type IError interface {
	Error() string
}

// IBytes is used for type assert api for Bytes().
type IBytes interface {
	X取字节集() []byte
}

// IInterface is used for type assert api for Interface().
type IInterface interface {
	X弃用_Interface() interface{}
}

// IInterfaces is used for type assert api for Interfaces().
type IInterfaces interface {
	X取any数组() []interface{}
}

// IFloats is used for type assert api for Floats().
type IFloats interface {
	X取小数数组() []float64
}

// IInts is used for type assert api for Ints().
type IInts interface {
	X取整数数组() []int
}

// IStrings is used for type assert api for Strings().
type IStrings interface {
	X取文本数组() []string
}

// IUints is used for type assert api for Uints().
type IUints interface {
	X取正整数数组() []uint
}

// IMapStrAny is the interface support for converting struct parameter to map.
type IMapStrAny interface {
	X取MapStrAny() map[string]interface{}
}

// IUnmarshalText is the interface for custom defined types customizing value assignment.
// Note that only pointer can implement interface IUnmarshalText.
type IUnmarshalText interface {
	UnmarshalText(text []byte) error
}

// IUnmarshalJSON is the interface for custom defined types customizing value assignment.
// Note that only pointer can implement interface IUnmarshalJSON.
type IUnmarshalJSON interface {
	UnmarshalJSON(b []byte) error
}

// IUnmarshalValue is the interface for custom defined types customizing value assignment.
// Note that only pointer can implement interface IUnmarshalValue.
type IUnmarshalValue interface {
	UnmarshalValue(interface{}) error
}

// ISet is the interface for custom value assignment.
type ISet interface {
	X设置值(value interface{}) (old interface{})
}

// IGTime is the interface for gtime.Time converting.
type IGTime interface {
	X取gtime时间类(format ...string) *gtime.Time
}
